import request from '@/utils/request'

//! 数据
export function getEnterpriseAPI(params) {
  return request({
    url: '/park/enterprise',
    method: 'GET',
    params
  })
}

//! 添加（企业列表）
export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/industry',
    method: 'GET',
    params
  })
}

//! 上传营业执照
export function upLoadBusinessAPI(data) {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}

//! 新增企业
export function createExterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}
//! 编辑企业
export function getEnterpriseDetailAPI(id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}

// !编辑提交接口
export function enterpriseDetaAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}

//! 获取合同列表数据
export function getRentListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}

//! 删除接口
export function romoveEnterpriseAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'DELETE'
  })
}

//! 获取添加合同 楼宇列表数据
export function getRentBuildListAPI() {
  return request({
    url: '/park/rent/building'
  })
}

//! 添加/续租企业的租赁合同
export function createRentAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}

//! 退租租赁合同状态
export function outRentAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'PUT'
  })
}

